package com.shanzmoo.db.module.member.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.shanzmoo.db.module.member.entity.MemberActivityConfigDetailEntity;
import com.shanzmoo.db.module.member.mapper.MemberActivityConfigDetailMapper;
import com.shanzmoo.db.module.member.service.IMemberActivityConfigDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 会员活动 服务实现类
 * </p>
 *
 * @author wangyudi
 * @since 2021-03-29
 */
@Service
public class MemberActivityConfigDetailServiceImpl extends ServiceImpl<MemberActivityConfigDetailMapper, MemberActivityConfigDetailEntity> implements IMemberActivityConfigDetailService {

    @Override
    public List<MemberActivityConfigDetailEntity> getbyActivityConfigId(Integer id) {
        return list(
                new LambdaQueryWrapper<MemberActivityConfigDetailEntity>()
                .eq(MemberActivityConfigDetailEntity::getAcivityId,id)
                .eq(MemberActivityConfigDetailEntity::getDeleted,false)
        );
    }

    @Override
    public void deleteByConfigId(Integer id) {
        remove(
                new LambdaQueryWrapper<MemberActivityConfigDetailEntity>()
                .eq(MemberActivityConfigDetailEntity::getAcivityId,id)
        );
    }
}
